package com.carmeth.geo;

import com.carmeth.geo.bean.Casa;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class CasaDetail extends Activity{
	
	private final String CLASS=this.getClass().getSimpleName();
	private Casa c;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.detail);
		
		c = (Casa) getIntent().getSerializableExtra("casa");
		
		replaceText(R.id.cntTitulo, c.getTitulo());
		replaceText(R.id.cntDescripcion, c.getDescripcion());
		replaceText(R.id.cntCalle, c.getDireccion().getCalle());
		replaceText(R.id.cntNumero, c.getDireccion().getNumero());
		replaceText(R.id.cntColonia, c.getDireccion().getColonia());
		replaceText(R.id.cntEstado, c.getDireccion().getEstado());
		replaceText(R.id.cntPrecio, c.getPrecio().toString());
		replaceText(R.id.cntRecamaras, c.getRecamaras().toString());
		replaceText(R.id.cntBanios, c.getBanios().toString());
		replaceText(R.id.cntColor, c.getColor());
		replaceText(R.id.cntConstruccion, c.getConstruccion());
		replaceText(R.id.cntPisos, c.getPisos().toString());		
	}
	
	private void replaceText(int id, String text){
		((TextView)findViewById(id)).setText(text);
	}
}
